home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / RLaB / help / members < prev    next >
Text File  |  1994-04-25  |  670b  |  23 lines

  1. members:
  2.  
  3. Syntax:    members ( L )
  4.  
  5. Description:
  6.  
  7.     The members function takes a single list as an argument (L),
  8.     and returns a string-vector containing the list's member
  9.     names. 
  10.  
  11.     For example: `x = members ($$)' will create a row-vector
  12.     (type: string) and assign it to `x'. The row-vector will
  13.     contain the names of all the elements of the
  14.     global-symbol-table.
  15.  
  16.     The members function is probably most useful when used in
  17.     conjunction with for-loops. The result of members() can be
  18.     used as the loop index, allowing users to operate on the
  19.     elements of a list:
  20.  
  21.     ll = << a = rand(3,3); b = rand(3,3); c = rand(3,3) >>;
  22.     for (i in members (ll)) { ll.[i] = diag(ll.[i]); }
  23.